<template>
    <div id="v-on">
      {{name}}
      <button v-on:click="get">得到name值</button>
      <button v-on:click="change">改变name值</button>
      <br/>
      <br/>
      <span v-text="name1"></span>
      <div v-html="name1"></div>
      <br/>
      <br/>
      <button @click="submit">提交</button>
      <input type="text" @keydown.enter="kd"/>
      <form @submit.prevent action="http://itcast.cn">
        <input type="submit" @click="submit" value="提交表单"/>
      </form>
    </div>
</template>

<script>
    export default {
      name: "von",
      data(){
        return{
          name:'黑马程序员',
          name1:'<h1>黑马程序员</h1>'
        }
      },
      methods:{
          get:function () {
            return this.name;
          },
        change:function () {
          this.name += '1';
        },
        submit:function () {
            alert('ok');
        },
        kd:function () {
          alert('kd');
        }
      }
    }
</script>

<style scoped>

</style>
